package com.example.wan1.utils;

import android.content.Context;

import com.example.wan1.data.BaseObserver;
import com.example.wan1.data.RetrofitUtil;
import com.example.wan1.data.RxSchedulers;
import com.example.wan1.model.CoinBean;

/***
 * 创建时间：2020/8/9 19:50
 * 创建人：10850
 * 功能描述：
 */
public class AppUtils {

    private static CoinBean bean = null;

    public static CoinBean getCoin(Context context) {
        RetrofitUtil.getInstance().getCoin()
                .compose(RxSchedulers.observableIO2Main())
                .subscribe(new BaseObserver<CoinBean>() {
                    @Override
                    public void onSuccess(CoinBean result) {
                        bean = result;
                    }

                    @Override
                    public void onFailure(Throwable e, String errorMsg) {
                        //JumpTool.goLogin(context);
                        //isLogin = false;
                    }
                });
        return bean;
    }

//    private static boolean isLogin = true;
//
//    public static boolean isLogin() {
//        return isLogin;
//    }
//
//    public static void setIsLogin(boolean is) {
//        isLogin = is;
//    }
}
